from api.ihrm_ import Ihrm
from common.assert_tools import assert_tools
from common.mysql_ import DB_Tool
import pytest

from common.read_common import read
from common.token01 import login
from config import BASE_PATH

class TestAdd:
    def setup(self):
        delete = DB_Tool().iud("delete from bs_user where mobile = 15288888888")
        return delete
    def teardown(self):
        delete2 = DB_Tool().iud("delete from bs_user where mobile = 15288888888")
        return delete2
    @pytest.mark.parametrize("dase,req_body,status,success,code,message",read(BASE_PATH +"/data/lalal02.json"))
    def testadd01(self,dase,req_body,status,success,code,message):
        req_headers=login()
        a = Ihrm()
        resp = a.ihrm_post(req_headers,req_body)
        print(resp.json())
        assert_tools(resp,status,success,code,message)
